package sq

import (
	"fmt"
	"sync"
)

var once sync.Once

type (
	mysqlDialect struct {
		commonDialect
	}

	postgresDialect struct {
		commonDialect
	}

	sqlite3Dialect struct {
		commonDialect
	}

)

func init() {
	once.Do(
		func() {
			RegisterDialect("mysql", &mysqlDialect{})
			RegisterDialect("postgres", &postgresDialect{})
			RegisterDialect("sqlite3", &sqlite3Dialect{})
		})
}

func (mysqlDialect) GetName() string {
	return "mysql"
}

func (mysqlDialect) Quote(key string) string {
	return fmt.Sprintf("`%s`", key)
}


func (postgresDialect) GetName() string {
	return "postgres"
}

func (sqlite3Dialect) GetName() string {
	return "sqlite3"
}